package mylab.utils.common;


import org.yaml.snakeyaml.Yaml;

import java.io.InputStream;

import lombok.experimental.UtilityClass;

@UtilityClass
public class YamlUtil {

    public <T> T loadAs(String yamlString, Class<T> type) {
        Yaml yaml = new Yaml();
        return yaml.loadAs(yamlString, type);
    }

    public <T> T loadAs(InputStream inputStream, Class<T> type) {
        Yaml yaml = new Yaml();
        return yaml.loadAs(inputStream, type);
    }
}
